home *** CD-ROM | disk | FTP | other *** search
/ Aminet 23 / Aminet 23 (1998)(GTI - Schatztruhe)[!][Feb 1998].iso / Aminet / util / cli / LibMon.lha / Src / output.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-10-28  |  1.9 KB  |  111 lines

  1. #include <exec/types.h>
  2.  
  3. #include <stdio.h>
  4.  
  5. #include "version.h"
  6. #include "libinfo.h"
  7. #include "output.h"
  8.  
  9.  
  10. /* Information for C:Version */
  11. const char verstr[] = "$VER: LibMon "PROG_VER"."PROG_REV" ("PROG_DATE")";
  12.  
  13.  
  14. /*--- Output ---*/
  15.  
  16. /*
  17. ** Output LibMon header
  18. */
  19. void OutputHeader(void)
  20. {
  21.   BoldText();
  22.   puts("Library Monitor v"PROG_VER"."PROG_REV" © "PROG_DATE" Karl J. Ots");
  23.   PlainText();
  24.   puts("");
  25. }
  26.  
  27. /*
  28. ** Output usage information
  29. */
  30. void OutputUsage(void)
  31. {
  32.   puts("Usage: LibMon <libraries> <ALL> <LIST> <FLUSH>");
  33.   puts("");
  34. }
  35.  
  36. /*
  37. ** Output Library Info Header
  38. */
  39. void OutputLibInfoHeader(void)
  40. {
  41.   Colour2Text();
  42.   puts("Address    Library                     Version     Pri   OpenCnt");
  43.   PlainText();
  44. }
  45.  
  46. /*
  47. ** Output specified Library Info data
  48. */
  49. void OutputLibInfo(struct LibInfo *li)
  50. {
  51.   printf("%08X   %-25s   %3d.%-4d   %4d   %5d\n",li->Address,
  52.                                                  li->Name,
  53.                                                  li->Version,
  54.                                                  li->Revision,
  55.                                                  li->Priority,
  56.                                                  li->OpenCount);
  57. }
  58.  
  59. /*
  60. ** Output flushed Library Information data
  61. */
  62. void OutputFlushedLibInfo(struct LibInfo *li)
  63. {
  64.   printf("%s v%d.%d flushed.\n",li->Name,
  65.                                 li->Version,
  66.                                 li->Revision);
  67. }
  68.  
  69. /*
  70. ** Output that library could not be found
  71. */
  72. void OutputLibNotFound(STRPTR name)
  73. {
  74.   printf("           %s was not found in memory.\n",name);
  75. }
  76.  
  77.  
  78. /*--- Text colour/style ---*/
  79.  
  80. /*
  81. ** Change to plain text
  82. */
  83. void PlainText(void)
  84. {
  85.   printf("\033[0m");
  86. }
  87.  
  88. /*
  89. ** Change to bold text
  90. */
  91. void BoldText(void)
  92. {
  93.   printf("\033[1m");
  94. }
  95.  
  96. /*
  97. ** Change text colour to #2
  98. */
  99. void Colour2Text(void)
  100. {
  101.   printf("\033[32m");
  102. }
  103.  
  104. /* 
  105. ** Change text colour to #3
  106. */
  107. void Colour3Text(void)
  108. {
  109.   printf("\033[33m");
  110. }
  111.